home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Sample Code / Pascal Sample 3.0B10 / Source / TrafficLights.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-13  |  4.0 KB  |  107 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2. *
  3. * TrafficLights.h -- constants for the TrafficLights code and resources
  4. *
  5. * Developer Support Center
  6. * Apple Computer, Inc.
  7. * Copyright 1988-1993, Apple Computer, Inc.  All rights reserved.
  8. *
  9. * This file contains constant definitions for the TrafficLights code, including
  10. * dialog IDs, resource IDs, defaults and the like.
  11. *
  12. ******************************************************************************/
  13.  
  14. /******************************************************************************
  15. *
  16. * Which version:
  17. *
  18. * MPW users can define this in the makefile, but SARez or THINK Rez users
  19. * can't (though you can set it with THINK Rez and THINK C 6.0).  Since
  20. * there's no consistent way to externally define this across development
  21. * environments, we define it here.
  22. *
  23. ******************************************************************************/
  24.  
  25. #define PascalVersion
  26. #undef CVersion
  27.  
  28. /* Constants dealing with defaults */
  29.  
  30. #define kMaxCircles        10            /* For static arrays, there has to be a limit */
  31. #define kDefaultNum        3            /* Default number of circles per document */
  32. #define rWindow            128            /* The 'WIND' resource we use */
  33.  
  34. #define rDefaultFonts    1000        /* 'STR#' resource with default font names */
  35. #define rDefaultStrings    1001        /* 'STR#' resoruce with default circle texts */
  36. #define rDefaultSizes    1000        /* 'DfSz' resource with default text sizes */
  37. #define rDefaultColorID    1000        /* 'RGB ' resource with default color */
  38.  
  39. /* Constants for alerts for errors we might encounter */
  40.  
  41. #define rNoMemForWindow    2000        /* No memory for new window or document */
  42. #define rReallyRevert    2010        /* Alert asking if it's OK to revert    */
  43. #define rNoMemoryForOperation 2011
  44.                                     /* Alert saying we can't do the modify
  45.                                        circle dialog because there's no memory     */
  46.  
  47. /* Constants having to do with the preferences file */
  48.  
  49. #define rPrefsFileName        128        /* 'STR ' resource containing the preferences
  50.                                        file name                                */
  51. #define kSamplePrefsType    'Pref'    /* File type of our preferences file */
  52. #define kSamplePrefsRsrc    'Pref'    /* Resource type of the prefs resource in it */
  53.  
  54. /* Define the OSType for the creator for documents we create */
  55.  
  56. #ifdef PascalVersion
  57. #define kOurCreatorType        'DSp1'
  58. #endif
  59.  
  60. #ifdef CVersion
  61. #define kOurCreatorType        'DSc1'
  62. #endif
  63.  
  64. /* Constants for the files we save */
  65.  
  66. #define kOurDocumentType    'DSp1'            /* the file type for our documents         */
  67.                                     
  68. #define kFileInternalVersionID        1        /* internal version number for our file
  69.                                                format; we can't read files if the
  70.                                                version inside them is bigger than
  71.                                                this value                           */
  72. #define rMiscStrings        1004            /* Miscellaneous file-related strings     */
  73. #define kSaveFileAs            1                /* "Save current document as:"            */
  74. #define kPickColor            2                /* "Select a color for this circle."    */
  75.  
  76. /* Options for the dirty flag for documents */
  77.  
  78. #define kDocumentDirty    1            /* Document needs saving to disk                 */
  79. #define kDocumentNew    2            /* Document is new -- enable save but don't
  80.                                        prompt to save when closing                    */
  81. #define kDocumentClean    3            /* Document is saved to disk                    */
  82.  
  83. /* Constants for balloon help resources */
  84.  
  85. #define kActiveCircleBalloonString        43    /* Balloon help string for active circle */
  86. #define kInactiveCircleBalloonString     44    /* Balloon help string for inactive one  */
  87. #define rBalloonHelpStringID            500    /* 'STR#' with most balloon help strings */
  88.  
  89. /* Constants for memory cushions and safeguards */
  90.  
  91. #define kDialogMemorySize    16 * 1024        /* We require this much memory available
  92.                                                in our heap to do the modify circle
  93.                                                dialog, realistically                 */
  94. #define kMemoryCushionSize    16 * 1024        /* To keep breathing room in our heap,
  95.                                                we won't open a new window unless
  96.                                                this much space is available in our
  97.                                                heap.                                */
  98.                                                
  99. /* Constants defining TrafficLight-specific menus.  Menus start with "m"
  100.    and items start with "i".                                                        */
  101.  
  102. #define mCircle        131                /* the Circle menu ID */
  103. #define iAdd        1
  104. #define iModify        2
  105. #define iDelete        3
  106.  
  107.